<?php	
defined('YOCTO_EXE') or die(_("Sorry, access Denied."));

/**
 * app/startup/app_log.php
 *
 * @author 		Kris Rybak <kris.rybak@krisrybak.com>	
 * @copyright 	2012 Kris Rybak
 * @since 		File available since Release 1.0.0
 * @version 	1.0.0
*/

	if (!$app) {
		$app = array();
		addTimeLog('app_log');
	}

	function addTimeLog($event) {
		global $app;
		$app['log'][] = array('time' => microtime(true), 'event' => $event);
	}

	function totalTimeLog() {
		global $app;
		$start = reset($app['log']);
		$end = end($app['log']);
		$app['app_runtime'] = $end['time'] - $start['time'];
	} 